<%= simple_form_for([:admin, @item]) do |f| %>
  <% subnav_array = ['Attributes', 'Assets', 'Associations']
     subnav_array.concat ['Aromas', 'Recent Changes'] if params[:action] == 'edit' %>
  <%= render 'fae/shared/form_header', header: @klass_name, cloneable: true, subnav: subnav_array  %>

  <section class="content" id="attributes">

    <!-- Text inputs -->
    <%= fae_input f, :name,
      input_class: 'slugger',
      helper_text: 'text input',
      hint: '<h3>Normal Hint</h3><p>Yes, HTML is allowed</p>'.html_safe
    %>

    <%= fae_input f, :vintage,
      input_class: 'slugger',
      helper_text: 'text input'
    %>

    <%= fae_input f, :slug, helper_text: 'text input (populated from name and vintage)' %>

    <!-- Textareas -->
    <%= fae_input f, :intro, helper_text: 'texterea', markdown: true %>

    <%= fae_input f, :body,
        label: 'Body Content',
        wrapper_class: 'release_body-text_area--wrapper',
        input_class: 'release_body-text_area',
        helper_text: 'textarea',
        markdown_supported: true %>

    <%= fae_input f, :description, helper_text: 'texterea', markdown: true %>

    <%= fae_input f, :content, helper_text: 'texterea', html: true %>

    <!-- Prefix -->
    <%= fae_prefix f, :price, helper_text: 'prefix', prefix: '$', placeholder: '50.00' %>

    <!-- Suffix -->
    <%= fae_suffix f, :weight, helper_text: 'suffix', suffix: 'lbs' %>

    <!-- Video URL -->
    <%= fae_video_url f, :video_url, helper_text: "video url (default helper: Please enter your YouTube video ID. The video ID is between v= and & of the video's url. This is typically 11 characters long.)" %>

    <!-- Checkboxes: are the defult when displaying booleans -->
    <%= fae_input f, :featured, helper_text: 'checkbox' %>

    <!-- Radio Buttons Vertical Stack -->
    <%= fae_radio f, :on_stage, helper_text: 'radio vertical'  %>

    <!-- Radio Buttons Horizontal Stack -->
    <%= fae_radio f, :on_prod, type: 'inline', input_class: 'something', helper_text: 'radio Horizontal' %>

    <!-- Datepicker -->
    <%= fae_datepicker f, :release_date, helper_text: 'datepicker' %>

    <!-- Daterange -->
    <%= fae_daterange f, [:show, :hide], label: 'Show/Hide', helper_text: 'daterange' %>

    <!-- Hidden -->
    <%= fae_input f, :created_at, as: :hidden %>

  </section>

  <section class="content" id="assets">
    <%= content_tag :h2, 'Assets' %>

      <!-- Image Form -->
      <%= fae_image_form f, :bottle_shot, helper_text: 'image form (w/ alt)', required: true %>

      <%= fae_image_form f, :hero_image, helper_text: 'image form (w/ alt and caption)', show_caption: true %>

      <!-- File Form -->
      <%= fae_file_form f, :label_pdf, helper_text: 'file form' %>

  </section>

  <section class="content" id="associations">
    <%= content_tag :h2, 'Associations' %>

    <!-- Association/Large Pulldown -->
    <%= fae_association f, :varietal, helper_text: 'pulldown', input_class: 'slugger' %>

    <!-- Small Pulldown -->
    <%= fae_pulldown f, :wine, size: 'short', helper_text: 'pulldown short', collection: Wine.order(:name_en), label_method: :name_en  %>

    <!-- Multiselect -->
    <%= fae_multiselect f, :acclaims, label_method: :publication, helper_text: 'mutliselect' %>

    <!-- Multiselect: two-pane -->
    <%= fae_multiselect f, :selling_points, two_pane: true, helper_text: 'two-pane mutliselect' %>

    <!-- Checkboxes: Vertical Stack -->
    <%= fae_checkbox f, :events, helper_text: 'checkboxes vertical' %>

  </section>
<% end %>

<!-- Nested Table -->
<% if params[:action] == 'edit' %>
  <section class="content" id="aromas">
    <%= render 'fae/shared/nested_table',
      assoc: :aromas,
      parent_item: @item,
      cols: [:name, :live],
      ordered: true,
      header: 'Aromas (nested table)' %>
  </section>
<% end %>

<%= render 'fae/shared/recent_changes' %>
